<template>
  <!-- 图文、视频预览组件 -->
  <el-dialog :visible.sync="dialogVisible" v-if="dialogVisible" :append-to-body="true" :show-close="false" width="800px" @close="close">
    <div class="header">
      <div><span class="line"></span>{{ detail.title }}</div>
      <i class="el-icon-close" @click="close"></i>
    </div>
    <!-- <div class="material-tag">
        <span class="tag" v-for="(item, index) in detail.labels">{{ item }}</span>
      </div> -->
    <!-- <div class="material-time">
        上传时间：2024年10月11日
      </div> -->
    <el-row :gutter="10" class="mb8">
      <!-- 图片 -->
      <div class="material-video">
        <img style="width: 100%;" :src="detail.preViewUrl" alt="">
      </div>
    </el-row>
  </el-dialog>
</template>

<script>
export default {
  name: "Preview",
  data () {
    return {
      title: "",
      dialogVisible: false,
      // 表单参数
      detail: {},
      options: {}
    };
  },
  methods: {
    close () {
      this.dialogVisible = false;
    },
    show (detail) {
      console.log(111111)
      this.detail = detail;
      this.dialogVisible = true;
    }
  },
};
</script>
<style scoped lang="scss">
.btn {
  width: 100%;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.material-video {
  img {
    width: 100%;
  }
}

.material-desc {
  max-height: 500px;
  overflow-y: scroll;
  line-height: 22px;
  font-size: 14px;
}

.header {
  display: flex;
  justify-content: space-between;
  padding: 20px 0 0;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  .line {
    display: inline-block;
    width: 2px;
    height: 13px;
    background-color: #2552E4;
    margin-right: 5px;
  }

  i {
    font-size: 26px;
    cursor: pointer;
    margin-left: 60px;
  }
}

.material-time {
  margin-bottom: 10px;
  border-bottom: 1px solid #D4DEEA;
  padding-bottom: 10px;
  font-size: 12px;
}

.material-tag {
  margin: 10px 0 10px;

  .tag {
    display: inline-block;
    background: rgba(9, 184, 68, 0.08);
    color: #09B844;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 2px;
    margin-right: 10px;
  }

  .tag:last-child {
    background: rgba(0, 87, 255, 0.08);
    color: #0057FF;
  }
}

::v-deep {
  .el-dialog__header {
    padding: 0;
  }
}
</style>
